import request from "@/utils/request";

/**
 * 商品分类树
 */
export const getCategoryTree = (search = "") => {
  return request({
    url: `/mall/tenant/category/getcategoryList?search=${search}`,
    method: "get"
  });
};
/**
 * 1.发包价管理列表
 */
export const managementList = params => {
  return request({
    url: "/mall/tenant/contractPrice/management/list",
    method: "get",
    params
  });
};
/**
 * 1.2.发包价管理导出
 */
export const managementExport = data => {
  return request({
    url: "/mall/tenant/contractPrice/management/export",
    method: "post",
    data,
    responseType: "blob"
  });
};
/**
 * 3.发包价管理导入
 */
export const managementImport = (filePath, data) => {
  return request({
    url: `/mall/tenant/contractPrice/management/import?filePath=${filePath}`,
    method: "post",
    data
  });
};
/**
 * 4.发包价管理导入日志
 */
export const logsList = params => {
  return request({
    url: "/mall/tenant/contractPrice/management/logs",
    method: "get",
    params
  });
};
/**
 * 4.5.删除导入记录
 */
export const deleteLogs = id => {
  return request({
    url: `/mall/tenant/contractPrice/management/logs/${id}`,
    method: "delete"
  });
};
/**
 * 4.5.6.修改发包价
 */
export const update = data => {
  return request({
    url: "/mall/tenant/contractPrice/management/update",
    method: "post",
    data
  });
};
